<template>
  <section>
    <div class="content-title">{{ title }}</div>
    <div class="content-wrap">
      <div v-for="(x, y) in nodeVersions" :key="y" @click="selectNode(y)">{{ x.name }}</div>
    </div>
  </section>
</template>
<script setup>
import { getCurrentInstance, onMounted } from 'vue'
const { proxy } = getCurrentInstance()
const props = defineProps({
  title: {
    type: String,
    defalut: ''
  }
})
const nodeVersions = [
  { name: '13.14.0' },
  { name: '20.13.1' },
  { name: '20.19.5' },
]
const selectNode = (y) => {
  const path = `D:/longxin/bats/${nodeVersions[y].name}.bat`
  proxy.$system.openFile(path)
}
onMounted(()=>{

})
</script>
<style scoped lang="scss">
.content-wrap {
  display: flex;
  flex-wrap: wrap;

  >div {
    width: 30%;
    height: 40px;
    border: 1px solid #fff;
    // background-color: #ffe87f;
    // color: red;
    margin: 5px;
    padding: 5px;
    display: flex;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 5px;
  }
}
</style>
